#pragma once
#include "../../EdgeGraphics/Texture2D.h"

// Details the height information of the ground
class Heightmap
{
	Vector3* rawNormalData = nullptr;
	float* rawHeightData = nullptr;
	
	Texture2D* heightData = nullptr;
	Texture2D* normalData = nullptr;

	unsigned int width = 0;
	unsigned int height = 0;

	float lowest = 0.f;
	float heighest = 0.f;

public:
	Heightmap(const char* filename, unsigned int MapWidth, unsigned int MapHeight, float lowest, float highest);
	virtual ~Heightmap(void);
	
	// retrieve the height at a spesific point in the map
	float GetHeightAt(int x, int y);

	/////////////////////<Accessors>//////////////////////////////////////////

	// the 2D width of the height map
	unsigned int getWidth(void) const { return width; }
	// the 2D height of the height map
	unsigned int getHeight(void) const { return height; }
	// the lowest y value on the hightmap
	float getLowest(void) const { return lowest; }
	// the hightest point on the heightmap
	float getHeighest(void) const { return heighest; }

	Texture2D* getHeightData(void) const { return heightData; }

	Texture2D* getNormalData(void) const { return normalData; }
};